home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / EXAMPLES / IDRAW / DRAWINGV.H < prev    next >
C/C++ Source or Header  |  1980-01-05  |  3KB  |  103 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. // $Header: drawingview.h,v 1.11 89/10/09 14:47:53 linton Exp $
  24. // declares class DrawingView.
  25.  
  26. #ifndef drawingview_h
  27. #define drawingview_h
  28.  
  29. #include <InterViews/Graphic/grblock.h>
  30.  
  31. // Declare imported types.
  32.  
  33. class Damage;
  34. class Page;
  35. class Rubberband;
  36. class Selection;
  37. class SelectionList;
  38. class State;
  39. class TextEdit;
  40.  
  41. // A DrawingView displays the user's drawing.
  42.  
  43. class DrawingView : public GraphicBlock {
  44. public:
  45.  
  46.     DrawingView(Page*);
  47.     ~DrawingView();
  48.  
  49.     void SetSelectionList(SelectionList*);
  50.     void SetState(State*);
  51.     void SetTools(Interactor*);
  52.  
  53.     void Draw();
  54.     void Handle(Event&);
  55.  
  56.     void Manipulate(
  57.     Event&, Rubberband*, int, boolean constrain=true, boolean erase=true
  58.     );
  59.     void Edit(Event&, TextEdit*, Graphic* = nil);
  60.  
  61.     void DrawHandles();
  62.     void RedrawHandles();
  63.     void EraseHandles();
  64.     void EraseExcessHandles(SelectionList*);
  65.     void ErasePickedHandles(Selection*);
  66.     void ErasePickedHandles(SelectionList*);
  67.     void EraseUngraspedHandles(Selection*);
  68.     void ResetAllHandles();
  69.  
  70.     void Added();
  71.     void Damaged();
  72.     void Repair();
  73.  
  74.     void Magnify(Coord, Coord, Coord, Coord);
  75.     void Reduce();
  76.     void Enlarge();
  77.     void NormalSize();
  78.     void ReduceToFit();
  79.     void CenterPage();
  80.  
  81. protected:
  82.  
  83.     void Reconfig();
  84.     void Redraw(Coord, Coord, Coord, Coord);
  85.     void Resize();
  86.     float LimitMagnification(float);
  87.     void StartTextEditing(Event&, TextEdit*, Graphic*);
  88.     void EndTextEditing();
  89.     void RedrawTextEditor();
  90.  
  91.     Damage* damage;        // keeps track of damaged areas of drawing
  92.     Graphic* gs;        // remembers text being edited
  93.     Page* page;            // snaps points to grid
  94.     Painter* rasterxor;        // stores painter with which to draw handles
  95.     SelectionList* sl;        // lists current Selections
  96.     State* state;        // stores Graphic and nonGraphic attributes
  97.     TextEdit* textedit;        // redraws in-place texteditor if necessary
  98.     Interactor* tools;        // handles events
  99.  
  100. };
  101.  
  102. #endif
  103.